package com.kedacom.freedomLabel.model.excel;

import android.support.annotation.NonNull;

import com.kedacom.freedomLabel.excel.AdditionalColumn;
import com.kedacom.freedomLabel.excel.IRowRecord;
import com.kedacom.freedomLabel.excel.ISheetRecord;
import com.kedacom.freedomLabel.model.bean.Business;

import java.util.List;

public class BusinessSheet implements ISheetRecord {

    private List<Business> rowRecords;
    private String sheetName = "称重明细";
    private AdditionalColumn[] additionalColumns = new AdditionalColumn[0];

    public BusinessSheet(List<Business> rowRecords) {
        this.rowRecords = rowRecords;
    }

    public BusinessSheet(List<Business> rowRecords, String sheetName) {
        this.rowRecords = rowRecords;
        this.sheetName = sheetName;
    }

    public BusinessSheet(List<Business> rowRecords, String sheetName, AdditionalColumn[] additionalColumns) {
        this.rowRecords = rowRecords;
        this.sheetName = sheetName;
        this.additionalColumns = additionalColumns;
    }

    @Override
    public String sheetName() {
        return this.sheetName;
    }

    @NonNull
    @Override
    public String[] columnNames() {
        return new String[]{"产品编号", "产品名称","净重", "毛重","单位","数量", "上限", "下限","创建时间","操作员","操作员卡号","ID1","ID2","ID3","ID4","ID5","ID6",};
    }

    @NonNull
    @Override
    public AdditionalColumn[] additionalColumnNames() {
        return this.additionalColumns;
    }

    @NonNull
    @Override
    public List<? extends IRowRecord> getRowRecords() {
        return this.rowRecords;
    }

    public void setRowRecords(List<Business> rowRecords) {
        this.rowRecords = rowRecords;
    }

    public void setSheetName(String sheetName) {
        this.sheetName = sheetName;
    }
}
